package math

func rand10() int {

	for {
		x := (rand7()-1)*7 + rand7()
		if x <= 40 {
			return x%10 + 1
		}

		x = (x-40-1)*7 + rand7()
		if x <= 60 {
			return x%10 + 1
		}

		x = (x-60-1)*7 + rand7()
		if x <= 20 {
			return x%10 + 1
		}
	}
}

func rand7() int {
	return 7
}
